//
//  ErrorCode.m
//  BOOOP
//
//  Created by booop on 15/2/5.
//  Copyright (c) 2015年 booop. All rights reserved.
//

#import "ErrorCode.h"

@implementation ErrorCode

+ (void)errorStatusAnalytical:(NSDictionary *)errorDic
{
    if ([errorDic objectForKey:@"error_desc"]) {
        [Utility showHint:errorDic[@"error_desc"]];
    }
}

+ (void)errorCodeAnalytical:(NSError *)error
{
    NSLog(@"code=%ld, %@", (long)error.code, error);
    NSInteger code = error.code;
    switch (code) {
        case -1011:
        case -1004:
            [Utility showHint:@"服务器开小差，请稍后重试"];
            break;
        case -1001:
            [Utility showHint:@"请求失败，请检查网络"];
            break;
        default:
            break;
    }
}

@end
